﻿namespace Quail.Helpers
{
    /// <summary>
    /// A Name Value pair
    /// <para>
    /// This is used for entity values that are drop downs or radio buttons 
    /// were we want to store the Name (Label) and the Value of the control.
    /// </para>
    /// </summary>
    public class NameValuePair : TwoThings<string, string>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="NameValuePair"/> class.
        /// </summary>
        public NameValuePair()
            : base(null, null)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="NameValuePair"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="value">The value.</param>
        public NameValuePair(string name, string value)
            : base(name, value)
        {
        }

        /// <summary>
        /// Gets or sets Name
        /// </summary>
        public string Name
        {
            get { return Thing1; }
            set { Thing1 = value; }
        }

        /// <summary>
        /// Gets or sets Value
        /// </summary>
        public string Value
        {
            get { return Thing2; }
            set { Thing2 = value; }
        }

        /// <summary>
        /// Returns the Name property
        /// </summary>
        /// <returns>
        /// The Name property
        /// </returns>
        public override string ToString()
        {
            return Name;
        }
    }
}
